#include <vector>
#include <string>
#include <algorithm>
#include <iostream>

using namespace std;

bool C(const string& lhs,
       const string& rhs)
{
    return lhs < rhs;
}


int main()
{
    vector<string> v;

    v.push_back("1.0.0.1");
    v.push_back("1.1.0.1");
    v.push_back("1.0.4.1");
    v.push_back("1.3.0.1");
    v.push_back("1.0.2.1");
    v.push_back("0.0.0.1");

    sort(v.begin(), v.end(),C);

    for(int i=0; i<v.size(); i++)
    {
	    cout << v[i] << endl;
    }
    return 0;
}
